Hệ thống quản lý trường học bằng PHP / MySQLi

1
2 <?php
3 include(
"connect.php");
4 ?>
5 <?php
6 SESSION_START();
7 ?>
8
9 <!DOCTYPE html>
10 <html>
11
12 <head>
13     <meta charset=
"utf-8">
14     <meta name=
"viewport" content="width=device-width, initial-scale=1.0">
15     <title>school management system</title>
16     <link rel=
"shortcut icon" href="assets/img/title.gif" type="image/x-icon">
17     <link rel=
"stylesheet" href="assets/css/bootstrap.min.css">
18     <link href=
"assets/css/loader.css" rel="stylesheet" />
19     <script src=
"assets/js/canvasjs.min.js"></script>
20     <!--*****jquery -
3.2.1.js file supports the use of dropdown***-->
21     <script src=
"assets/js/jquery-3.2.1.js"></script>
22
23 <!--***************the year search text box*************************************************-->
24 <script>
25 function myFunction() {
26   
// Declare variables
27   
var input, filter, table, tr, td, i;
28   input = document.getElementById(
"myInput");
29   filter = input.
value.toUpperCase();
30   table = document.getElementById(
"myTable");
31   tr = table.getElementsByTagName(
"tr");
32
33   
// Loop through all table rows, and hide those who don't match the search query
34   
for (i = 0; i < tr.length; i++) {
35     td = tr[i].getElementsByTagName(
"td")[1];
36     
if (td) {
37       
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
38         tr[i].style.display =
"";
39       }
else {
40         tr[i].style.display =
"none";
41       }
42     }
43   }
44 }
45 </script>
46 <!--***************the year search text box*************************************************-->
47 <script>
48 function myFunction2() {
49   
// Declare variables
50   
var input, filter, table, tr, td, i;
51   input = document.getElementById(
"myInput2");
52   filter = input.
value.toUpperCase();
53   table = document.getElementById(
"myTable");
54   tr = table.getElementsByTagName(
"tr");
55
56   
// Loop through all table rows, and hide those who don't match the search query
57   
for (i = 0; i < tr.length; i++) {
58     td = tr[i].getElementsByTagName(
"td")[2];
59     
if (td) {
60       
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
61         tr[i].style.display =
"";
62       }
else {
63         tr[i].style.display =
"none";
64       }
65     }
66   }
67 }
68 </script>
69
70 </head>
71
72 <body >
73 <!--end of heading section-->
74 <ul
class="nav navbar-right top-nav">
75     <div
class="dropdown">
76   <button
class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" >
77   <?php
78         
//Check to see if the user is logged in.if not redirect user to the loging page.
79         
80         
if(isset($_SESSION['fname']))
81         {
82         echo
"Current user: ".$_SESSION['fname']. "&nbsp;".$_SESSION['lname']. " ";
83         }
else{
84           echo
"<script type='text/javascript'>
85                     alert( 'You must Log
in to use the system');
86                     </script>"
;
87                 echo
"<script>
88                     window.location = 'index.php'
89                   </script>"
;
90         }
91         ?>
92   <span
class="caret"></span></button>
93   <ul
class="dropdown-menu">
94       <li><a href=
"manage_account.php"><i class="fa fa-users fa-lg"></i>&nbsp;View User</a></li>
95       <li><a href=
"register_form.php"><i class="fa fa-users fa-lg"></i>&nbsp;Add New User</a></li>
96       <li
class="divider"></li>
97       <li><a href=
"session_logout.php"><i class="fa fa-fw fa-power-off"></i>&nbsp;Log Out</a></li>
98   </ul>
99 </div>
100   </ul>
101 <!--************************************************-->
102 <div style=
"
103     font-family:Nyala, Arial;
104     text-align: left;
105     background-color: #526F35;
106     padding: 20px;
107     color:white;
108     width:
100%;
109     height: 150px;"
>
110     <!--This codes to load the image loader-->
111     <div id=
"loading">
112             <img id=
"loading-image" src="assets/img/loader.gif" alt="Loading..." />
113     </div>
114 <!--
this is the heading section-->
115     <h2>
116             <?php
117             $sql=
"SELECT * FROM companyinfo";
118             $result=mysqli_query($db,$sql) or die(
"error getting data");
119             $num_rows=mysqli_num_rows($result);
120              
while($row=mysqli_fetch_array($result))
121                     {
122                     echo
'<image style="height:82px; width:82px;" src="data:image;base64,'. $row['clogo'].' "> ';
123                     $cname = $row[
'cname'];
124                      $cemail = $row[
'cemail'];
125                       $ccontact = $row[
'ccontact'];
126                        $clocation = $row[
'clocation'];
127                     }?>
128                     <?php
129                     echo $cname;
130                     ?>
131
132     <div style=
"float:right; font-size:20px;text-align:right;">
133     
134     <img src=
"assets/img/mail2.png">Email: <?php echo $cemail; ?><br>
135     <img src=
"assets/img/call1.png">Contact:<?php echo $ccontact; ?><br>
136     <img src=
"assets/img/location.png">Location: <?php echo $clocation; ?>
137     
138     </div>
139    </h2>
140 </div>
141 <!--end of heading section-->
142     
143     <div>
144         <ul
class="nav nav-tabs">
145             <li ><a href=
"homepage.php" >Administration <img src="assets/img/details.png"></a></li>
146             <li ><a href=
"students.php" >Students <img src="assets/img/student48.png"></a></li>
147             <li><a href=
"staff.php">Staff Member <img src="assets/img/staff48.png"></a></li>
148             <li><a href=
"course.php" >Courses <img src="assets/img/course.png"></a></li>
149             <li><a href=
"departments.php" >Departments <img src="assets/img/department.png"></a></li>
150             <li><a href=
"markstep1.php" >Exams <img src="assets/img/update.png"></a></li>
151             <li><a href=
"hostel.php" >Hostel <img src="assets/img/details.png"></a></li>
152             <li><a href=
"sms.php">SMS <img src="assets/img/details.png"></a></li>
153             <!--<li><a href=
"tab-8" role="tab" data-toggle="tab">Hostel <img src="assets/img/details.png"></a></li>
154             <li><a href=
"tab-7" role="tab" data-toggle="tab">Parents <img src="assets/img/details.png"></a></li>-->
155             
156         </ul>
157         <div
class="tab-content">
158             <div
class="tab-pane active" role="tabpanel" id="tab-1">
159                 
160                 <p>
161                     <div
class="table-responsive" >
162 <!--****************************************************************************-->
163                        
164   <!--*************************************************************************************************************************-->
165 <div id=
"page-wrapper">
166             <div
class="container-fluid">
167                 
168                 <!-- Page Heading -->
169                 <nav>
170                 
171                         <!-- block -->
172                         <div id=
"block_bg" class="block">
173                             <div
class="navbar navbar-inner block-header">
174                             <table>
175                             <tr>
176                             <div style=
"height:auto;
177                                         width:
100%;
178                                         background-color:orange;
179                                         border:1px solid red;"
>
180                                         The following students are expected to pay their installment
by 5th [month]
181                                         <a href=
"homepage.php">Back to homepage</a>
182                                         </div>
183                                                          
184                              </tr>
185                                                     
186                             <div
class="block-content collapse in">
187                                 <div
class="span12">
188     
189                             <form method=
"post">
190                                     <div
class="table-responsive">
191                                     <table cellpadding=
"0" cellspacing="0" border="0" class="table" id="myTable">
192                                     
193                                         <thead>
194                                           <tr>
195                                                 <th></th>
196                                                 <th><center>Adm No.</center></th>
197                                                 <th><center>Name</center></th>
198                                                 <th><center>Gender</center></th>
199                                                 <th><center>Class</center></th>
200                                                 <th><center>Mobile<br>[Send SMS]</center></th>
201                                                 <th><center>Address</center></th>
202                                                 <th><center>Reg. Date</center></th>
203                                                 <th><center>Pay</center></th>
204                                                 <th><center>View payment log</center></th>
205                                                 <th><center>Print Invoice</center></th>
206                                                 <script src=
"assets/js/jquery.dataTables.min.js"></script>
207                                                 <script src=
"assets/js/DT_bootstrap.js"></script>
208                                                 <th></th>
209                                            </tr>
210                                         </thead>
211                                         <tbody>
212                         <?php

213 //SELECT `reciept`, `method`, `refno`, `admission_number`, `tdate`, `course_id`, `term_id`, `amount`, `captured_by` FROM `fee` WHERE
1
214
215                     $sql =
"SELECT * from fee WHERE tdate NOT BETWEEN X1 AND X2";
216                     $user_query=mysqli_query($db,$sql) or die(
"error getting data");
217                     $num_rows=mysqli_num_rows($user_query);
218                     echo
"$num_rows Students found </font>";
219                     
while($row = mysqli_fetch_array($user_query)){
220                     $id = $row[
'admission_number'];
221                   
222                         ?>
223                                                 <tr>
224                                                 <td width=
"30">
225                                                 <input id=
"optionsCheckbox" class="uniform_on" name="selector[]" type="checkbox" value="<?php echo $id; ?>">
226                                                 </td>
227                                                 <td><center><?php echo $row[
'admission_number']; ?></center></td>
228                                                 <td><center><?php echo $row[
'sirname']." ".$row['firstname']." ".$row['lastname']; ?></center></td>
229                                                 <td><center><?php echo $row[
'gender']; ?></center></td>
230                                                 <td><center><?php echo $row[
'course_id']; ?></center></td>
231
232                                                 <td><center><a href=
"sms.php <?php echo '?id='.$id; ?>" class="btn btn-link">
233                                                 <?php echo $row[
'mobile']; ?>
234                                                 </a></center></center></td>
235
236                                                 <td><center><?php echo $row[
'address']."-".$row['zipcode']; ?></center></td>
237                                                 <td><center><?php echo $row[
'reg_date']; ?></center></td>
238                                             
239                                                 <td>
240                                                 <center><a href=
"fee.php <?php echo '?id='.$id; ?>" class="btn btn-warning"><i class="glyphicon glyphicon-ok-circle"></i>Pay</a></center></td>
241                                                 <td><center><a href=
"paymentlog.php <?php echo '?id='.$id; ?>" class="btn btn-primary"><i class="glyphicon glyphicon-eye-open"></i>View log</a></center></td>
242                                                 <td><center><a href=
"printfeeinvoice.php <?php echo '?id='.$id; ?>" class="btn btn-info"><i class="glyphicon glyphicon-print"></i>Print Invoice</a></center></td>
243                                             
244                             
245
246                             </tr>
247                                                 <?php } ?>
248                                         </tbody>
249                                     </table>
250                                 </form>
251                                 
252
253             </div>
254                             </div>
255                         </div>
256                     </div>
257             <!-- /.container-fluid -->
258
259         </div>
260         <!-- /#page-wrapper -->
261 </div>
262   <!--*********************************************************************************-->
263     <div
class="col-md-12" style="background-color:#526F35; bottom:0px;position:fixed;">
264         <p
class="text-center text-danger" style="color:white;" >@J. Muthama Tel: +254729734768</p>
265     </div>
266     <script src=
"assets/js/jquery.min.js"></script>
267     <script src=
"assets/bootstrap/js/bootstrap.min.js"></script>
268     <script src=
"assets/js/affix.js"></script>
269     <script src=
"assets/js/alert.js"></script>
270     <script src=
"assets/js/alert1.js"></script>
271     <script src=
"assets/js/bootstrap.js"></script>
272     <script src=
"assets/js/bootstrap.min.js"></script>
273     <script src=
"assets/js/bootstrap-datepicker.js"></script>
274     <script src=
"assets/js/bootstrap-wysihtml5.js"></script>
275     <script src=
"assets/js/button.js"></script>
276     <script src=
"assets/js/carousel.js"></script>
277     <script src=
"assets/js/chosen.jquery.min.js"></script>
278     <script src=
"assets/js/ckeditor.js"></script>
279     <script src=
"assets/js/collapse.js"></script>
280     <script src=
"assets/js/color.js"></script>
281     <script src=
"assets/js/dropdown.js"></script>
282     <script src=
"assets/js/DT_bootstrap.js"></script>
283     <script src=
"assets/js/dynamic.js"></script>
284     <script src=
"assets/js/ie-emulation-modes-warning.js"></script>
285     <script src=
"assets/js/jquery.dataTables.js"></script>
286     <script src=
"assets/js/jquery.dataTables.min.js"></script>
287     <script src=
"assets/js/jquery.dialog.js"></script>
288     <script src=
"assets/js/jquery.hoverdir.js"></script>
289     <script src=
"assets/js/jquery.jgrowl.js"></script>
290     <script src=
"assets/js/jquery.knob.js"></script>
291     <script src=
"assets/js/jquery.uniform.min.js"></script>
292     <script src=
"assets/js/jquery-1.8.3.min.js"></script>
293     <script src=
"assets/js/jquery-1.9.1.js"></script>
294     <script src=
"assets/js/jquery-1.9.1.min.js"></script>
295     <script src=
"assets/js/jquery-1.10.2.js"></script>
296     <script src=
"assets/js/jquery-1.11.0.js"></script>
297     <script src=
"assets/js/jquery-ui-1.9.2.custom.min.js"></script>
298     <script src=
"assets/js/jquery-ui-1.10.3.js"></script>
299     <script src=
"assets/js/modal.js"></script>
300     <script src=
"assets/js/modernizr-2.6.2-respond-1.1.0.min.js"></script>
301     <script src=
"assets/js/myjquery.js"></script>
302     <script src=
"assets/js/myjquery1.js"></script>
303     <script src=
"assets/js/npm.js"></script>
304     <script src=
"assets/js/popover.js"></script>
305     <script src=
"assets/js/profile.js"></script>
306     <script src=
"assets/js/raphael-min.js"></script>
307     <script src=
"assets/js/sb-admin-2.js"></script>
308     <script src=
"assets/js/scripts.js"></script>
309     <script src=
"assets/js/scrollspy.js"></script>
310     <script src=
"assets/js/tab.js"></script>
311     <script src=
"assets/js/tooltip.js"></script>
312     <script src=
"assets/js/transition.js"></script>
313     <script src=
"assets/js/wysihtml5-0.3.0.js"></script>
314     <script language=
"javascript" type="text/javascript">
315      $(window).load(function()
316       {
317         $(
'#loading').hide();
318       });
319 </script>
320 </body>
321
322 </html>


Gõ tìm kiếm nhanh...